Optimal. Leaf size=98 \[ -\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}-\frac {i}{d \sqrt {a+i a \tan (c+d x)}}+\frac {i \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 98, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3543, 3479, 3480, 206} \[ -\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}-\frac {i}{d \sqrt {a+i a \tan (c+d x)}}+\frac {i \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 3479
Rule 3480
Rule 3543
Rubi steps
\begin {align*} \int \frac {\tan ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx &=-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}-\int \frac {1}{\sqrt {a+i a \tan (c+d x)}} \, dx\\ &=-\frac {i}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}-\frac {\int \sqrt {a+i a \tan (c+d x)} \, dx}{2 a}\\ &=-\frac {i}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}+\frac {i \operatorname {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d}\\ &=\frac {i \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d}-\frac {i}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.79, size = 113, normalized size = 1.15 \[ -\frac {i \left (\sqrt {1+e^{2 i (c+d x)}} \left (1+5 e^{2 i (c+d x)}\right )-e^{i (c+d x)} \left (1+e^{2 i (c+d x)}\right ) \sinh ^{-1}\left (e^{i (c+d x)}\right )\right )}{d \left (1+e^{2 i (c+d x)}\right )^{3/2} \sqrt {a+i a \tan (c+d x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.44, size = 237, normalized size = 2.42 \[ \frac {{\left (i \, \sqrt {2} a d \sqrt {\frac {1}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (4 \, {\left ({\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {1}{a d^{2}}} + a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) - i \, \sqrt {2} a d \sqrt {\frac {1}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (-4 \, {\left ({\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {1}{a d^{2}}} - a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) + \sqrt {2} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} {\left (-10 i \, e^{\left (2 i \, d x + 2 i \, c\right )} - 2 i\right )}\right )} e^{\left (-i \, d x - i \, c\right )}}{4 \, a d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\tan \left (d x + c\right )^{2}}{\sqrt {i \, a \tan \left (d x + c\right ) + a}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.18, size = 73, normalized size = 0.74 \[ -\frac {2 i \left (\sqrt {a +i a \tan \left (d x +c \right )}-\frac {\sqrt {a}\, \sqrt {2}\, \arctanh \left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{4}+\frac {a}{2 \sqrt {a +i a \tan \left (d x +c \right )}}\right )}{d a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.77, size = 101, normalized size = 1.03 \[ -\frac {i \, {\left (\sqrt {2} a^{\frac {5}{2}} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) + 8 \, \sqrt {i \, a \tan \left (d x + c\right ) + a} a^{2} + \frac {4 \, a^{3}}{\sqrt {i \, a \tan \left (d x + c\right ) + a}}\right )}}{4 \, a^{3} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.26, size = 83, normalized size = 0.85 \[ -\frac {1{}\mathrm {i}}{d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}-\frac {\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}\,2{}\mathrm {i}}{a\,d}-\frac {\sqrt {2}\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {-a}}\right )\,1{}\mathrm {i}}{2\,\sqrt {-a}\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\tan ^{2}{\left (c + d x \right )}}{\sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________